System and method for providing indicators of textual items having intrinsic executable computational meaning within a graphical language environment

ABSTRACT

An electronic device with a graphical language environment that includes a method which examines a graphical model to identify textual items having intrinsic executable computational meaning within the graphical model is discussed. The method identifies at least one textual item with intrinsic executable computational meaning. The method further provides an indicator for the at least one identified textual item with intrinsic executable computational meaning in a display of the graphical model. The indicator may be based upon a characteristic of the identified textual item.

FIELD OF THE INVENTION

The illustrative embodiment of the present invention relates generallyto graphical models, and more particularly to a mechanism for providingindicators for identified textual items within the graphical model thathave intrinsic executable computational meaning.

BACKGROUND

Computer programmers spend large amounts of time editing and debuggingcomputer programs as part of the process by which the programs arecreated and optimized. In a textual language environment the editing anddebugging process requires the computer programmer to look at many linesof code. It can frequently be difficult to pick out important sectionsof code from all of the code surrounding the section of code that is ofinterest to the programmer. As a result, textual editors and debuggersoften include features which highlight or otherwise visually identifysemantically sensitive syntax that has meaning to the programmer.

In a graphical language environment, a graphical model is displayedwhich includes many graphical elements with interspersed textualelements. Some of the textual elements are labels for variouscomponents, while other textual elements represent items with intrinsicexecutable computational meaning that is related to the text and is ofinterest to the programmer attempting to edit or optimize the model.Unfortunately, conventional graphical language environments fail toprovide an automated mechanism for providing an indicator for textualelements which have intrinsic executable computational meaning within adisplayed graphical model where the indicator is based upon acharacteristic of the identified textual item.

BRIEF SUMMARY

The illustrative embodiment of the present invention provides amechanism for providing indicators of textual items within a displayedgraphical model which have intrinsic executable computational meaning.The illustrative embodiment utilizes the mapping performed by a languageprocessor evaluating the model to identify those textual items withinthe model that are executable based on the intrinsic meaning of thetextual item and affect the model execution. The displayed graphicalmodel is altered to provide an indicator of which textual items withinthe graphical model have intrinsic executable computational meaning withthe indicator being based on a characteristic of the identified textualitem.

In one aspect of the illustrative embodiment, a computational devicewith a graphical language environment includes a method which examines agraphical model to identify textual items having intrinsic executablecomputational meaning within the graphical model. The method identifiesat least one textual item with intrinsic executable computationalmeaning. The method further provides an indicator for the at least oneidentified textual item with intrinsic executable computational meaningin a display of the graphical model.

In another aspect of the illustrative embodiment, a system forindicating textual items with intrinsic executable computational meaningwithin a graphical environment includes a graphical model that includestextual and graphical components. The system further includes a languageprocessor for evaluating the textual and graphical components in thegraphical model to produce executable code. Additionally, the systemincludes a listing generated as a result of the evaluation of thetextual components in the graphical model by the language processor. Thelisting identifies at least one textual component with intrinsicexecutable computational meaning. The identified at least one textualcomponent with intrinsic executable computational meaning is altered inappearance in a display of the graphical model to a user based on acharacteristic of the identified textual item.

In still another aspect of the illustrative embodiment, a distributedsystem for indicating textual items with intrinsic executablecomputational meaning within a graphical environment includes a serverhosting a graphical language environment. The graphical languageenvironment further includes a graphical model that includes textual andgraphical components. The graphical language environment also includes alanguage processor for evaluating the textual and graphical componentsin the graphical model to produce executable code. Additionally, thegraphical language environment includes a listing of executable textualcomponents in the graphical model generated as a result of theevaluation of the graphical model by the language processor. The listingidentifies textual components with intrinsic executable computationalmeaning in the graphical model. The identified textual components withintrinsic executable computational meaning are altered in appearance ina display of the graphical model to a user. The distributed systemfurther includes a client communicating with the server over a networkand a display device in communication with the client. The displaydevice displays the graphical model with the altered textual items to auser.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention is pointed out with particularity in the appended claims.The advantages of the invention described above, as well as furtheradvantages of the invention, may be better understood by reference tothe following description taken in conjunction with the accompanyingdrawings, in which:

FIG. 1 depicts an environment suitable for practicing the illustrativeembodiment of the present invention;

FIG. 2 depicts an abstract syntax tree of the type that may be producedby the present invention in order to list identified textual items withintrinsic executable computational meaning;

FIG. 3 depicts an alternate distributed environment suitable forpracticing the illustrative embodiment of the present invention;

FIG. 4 depicts a sequence of steps followed by the illustrativeembodiment of the present invention to identify and provide indicatorsfor textual elements with intrinsic executable computational meaningwithin a graphic model;

FIG. 5A (Prior Art) depicts a graphical model;

FIG. 5B depicts the graphical model of FIG. 5A in which the illustrativeembodiment of the present invention provides visual indicators foridentified textual elements with intrinsic executable computationalmeaning within a graphical model.

FIG. 6A (Prior Art) depicts the graphical model of FIG. 5A with a secondtransition between states; and

FIG. 6B depicts the graphical model of FIG. 5B in which the illustrativeembodiment of the present invention provides different visual indicatorsfor identified textual elements with intrinsic executable computationalmeaning within a graphical model.

DETAILED DESCRIPTION

The illustrative embodiment of the present invention provides amechanism to automatically provide an indicator for textual elementsthat have intrinsic executable computational meaning in a displayedgraphical model. The provided indicator may be based upon acharacteristic of the textual item. The ability to distinguish betweenindicated text with intrinsic executable computational meaning and othertextual items allows programmers to more efficiently edit and optimizegraphical models by allowing the programmers to focus in on significantsections of the model.

The phrase “intrinsic executable computational meaning” is used hereinto distinguish between those textual items found in graphical modelswhich have executable computational meaning that is related to the worditself (e.g.: program language keywords, event names, data, graphicalfunction names, linked requirement, hard coded numbers, etc.), thosetextual items which are used in computations but have no intrinsicmeaning ( e.g.: a label for a block component in a model that is used asan alphabetical tiebreaker during the processing of components—there isexecutable computational meaning associated with the textual item but itis extrinsically assigned to the item rather than stemming from theprocessing of the word), and textual items that do not result in anysort of code that affects the execution of the model (e.g.: a textualcomment that is not processed by the compiler or interpreter).

FIG. 1 depicts an environment suitable for practicing the illustrativeembodiment of the present invention. A user 2 accesses an electronicdevice 4 using an input device 3 such as a mouse or keyboard. Theelectronic device 4 includes a graphical language environment such asSIMULINK or STATEFLOW, both from The MathWorks, Inc. of Natick, Mass.The graphical language environment includes at least one graphical model8. The graphical language environment 6 also includes a languageprocessor 10. The language processor 10 is used to examine the graphicalmodel 8 and generate a listing of identified textual items withintrinsic executable computational meaning The listing of identifiedtextual items with intrinsic executable computational meaning 12 may bederived from an abstract syntax tree. Abstract syntax trees arediscussed in greater detail below. The electronic device 4 is incommunication with a display 20 which is used to present a display ofthe graphical model being examined, including the indicated textualitems having intrinsic executable computational meaning.

The electronic device 4 may be a server, mainframe, laptop, workstation,PDA or some other type of electronic device equipped with a processorand capable of supporting the graphical language environment 6. Thegraphical language environment 6 may be a block diagram environment suchas SIMULINK, a state diagram and data-flow based diagram environmentsuch as STATEFLOW, LABVIEW from National Instruments Corporation ofAustin, Tex., Unified Modeling Language (UML) environments or some othertype of modeling environment in which models include both graphical andtextual components. The graphical model 8 may be a block diagram model,state-diagram model, a data-flow model or some other type of model.

The language processor 10 in the graphical language environment 6 mayprocess the graphical model 8 in a number of different ways in order toprovide the indicators of textual items with intrinsic executablecomputational meaning in the graphical model. In one implementation, thelanguage processor examines and tokenizes the textual items present inthe graphical model 8 such as STATEFLOW action language present instates or transitions. The tokens may then be looked up in a datadictionary 14 to determine which tokens have intrinsic executablecomputational meaning and arranged in a parse tree. The parse tree maythen be walked with the corresponding textual item in the graphicalmodel for each node being assigned an indicator to show it has intrinsicexecutable computational meaning.

In an alternative implementation, the language processor may evaluatethe entire model to generate code before identifying which textual itemsin the graphical model have intrinsic executable computational meaning.Graphical components in the graphical model 8 may represent and betranslated into program code by the language processor 10. Similarly,the textual items/components in the graphical model 8 may also representunderlying program code. How the textual items in the graphical model 8are treated by the language processor depends upon whether they haveintrinsic executable computational meaning or whether they lackintrinsic executable computational meaning. The graphical modelcomponents, textual and graphical; are first converted into thecorresponding underlying code associated with the components. Forexample, for a SIMULINK model, REAL TIME WORKSHOP may be used togenerate the code. The language processor 10 then tokenizes theunderlying code and the executable tokens are parsed into an abstractsyntax tree in a manner consistent with the language being processed.The use and creation of an abstract syntax tree are discussed in furtherdetail below. The listings of textual items that have intrinsicexecutable computational meaning are flagged in the tree in theillustrative embodiment. A data dictionary 14 may be used to identifywhich items have intrinsic executable computational meaning. Theabstract syntax tree serves as the basis for providing a visualindicator for the textual items by quickly searching the tree andhighlighting or otherwise altering the appearance of the correspondingitem in the displayed graphical model 22. It should be noted that theuse of the abstract syntax tree is optional, and other listings oftextual components with intrinsic executable computational meaning areconsidered to be within the scope of the present invention.

An example of the language processor 10 tokenizing and parsing code tocreate the abstract syntax tree of the present invention is nowillustrated. It will be appreciated that although the example of thetokenizing and parsing process given herein is made starting withreference to a traditional line of code rather than a component of agraphical model, the components in the graphical model 8, both graphicaland textual, correspond to and are translated into code beforeexecution. An initial line of code such as:z=a+foo(b);may be tokenized by the language processor 10 into the following tokens:{“z”, “=”, “a”, “+”, “foo”, “(“,“b”,”)”}The tokens in turn may then be parsed into an abstract syntax tree 30such as that depicted in FIG. 2. Nodes from tokens that started astextual items are noted and the tree may then be walked to identifywhere to provide visual indicators in the corresponding textualitems/components in the graphical model 8. Provisions may be made sothat the language processor 10 identifies any textual items withextrinsic executable computational meaning (such as the aforementionedlabels for blocks that are used as tiebreakers in determining executionorder) differently than those textual items with intrinsic executablecomputational meaning. The language processor consults pre-determinedparameters to determine the type of indicator provided (e.g. differentfont colors, shadings, marquee effects, blinking effects, etc.). In analternate implementation, the user may be presented with a choice of thetype of indicator to be used.

The illustrative embodiment of the present invention may also bepracticed utilizing a distributed architecture that enables theprocessing of the graphical model to occur at a remote location from theuser. FIG. 3 depicts an alternate distributed environment suitable forpracticing the illustrative embodiment of the present invention. Aserver 50 hosts a graphical language environment 52. The graphicallanguage environment 52 includes at least one graphical model 54, alanguage processor 56 and a listing of identified textual items withintrinsic executable computational meaning 58. The listing of identifiedtextual items with intrinsic executable computational meaning 58 mayappear as an abstract syntax tree generated by the language processorprocessing the graphical model. Alternatively, another type of listingwhich contains a record of the textual items with intrinsic executablecomputational meaning in the graphical model 54 may be kept in thegraphical language environment. The abstract syntax tree, or other typeof alternative listing, is checked to determine the identified textualelements with intrinsic executable computational meaning and indicatorsare assigned to the corresponding textual items in the graphical model54.

A user 40 accessing a client 42 communicates with the server 50 and thegraphical language environment 52 over a network 46. The network may bea local area network (LAN), wide area network (WAN), an extranet,intranet, internet, the Internet or some other type of network enablingthe client 42 to communicate with the server 50. Likewise, the network46 may be a wired network or a form of wireless network. A display ofthe graphical model showing the indicators of the textualitems/components in the graphical model 54 that have intrinsicexecutable computational meaning is transmitted over the network 46 tothe client 42 and displayed to the user 40 on a display device 44 thatis in communication with the client. It will be appreciated by thoseskilled in the art that although the terms “client” and “server” havebeen used to discuss the remote architecture implementation above, otherelectronic devices equipped with processors and capable of performingthe computational processes discussed herein that are not arranged in aclient-server relationship may also be used to practice the presentinvention in a distributed architecture.

FIG. 4 depicts the sequence of steps that may be followed by theillustrative embodiment of the present invention to provide indicatorsof textual components in a graphical model that have intrinsicexecutable computational meaning. The sequence begins when the usercreates or retrieves the graphical model (step 80). The languageprocessor 10 processes the graphical model and examines the graphicalmodel components (step 82). The listed textual items with intrinsicexecutable computational meaning within the model are then noted, eitherby using an abstract syntax tree or by using some other type of listingof processed components (step 84). The graphical model is then displayedwith an indicator showing the identified textual items with intrinsicexecutable computational meaning (step 86).

The form of the indicator may be based on the type of textual item orsome other characteristic of the identified textual item with intrinsicexecutable computational meaning. Those skilled in the art willappreciate that the type of indicator used to mark the textual itemshaving intrinsic executable computational meaning may vary dependingupon the implementation of the present invention. For example, theidentified textual item may be highlighted so as to stand out from thesurrounding components in the graphical model. Alternatively, theidentified textual item may be assigned a different font color than thesurrounding components in the graphical model. In one implementation,multiple colors may be used to distinguish between different types oftextual items with intrinsic executable computational meaning. Forexample, an event name may receive one color while a keyword receives adifferent color. Similarly, the textual item may be boxed or underlinedso as to draw attention the item. Other variations will be readilyapparent to those skilled in the art.

FIG. 5A (prior art) and FIG. 5B depict an example of the application ofthe present invention to a graphical model. FIG. 5A (prior art) depictsa graphical model 100 with a Shutdown state 102 and a Normal state 104.The transition from the Shutdown state 102 to the Normal state 104includes textual items RESTART 106, START 108 and variablenumFailures==0 (110). Similarly, the transition from the Normal State104 to the Shutdown state 102 includes the textual item FAULT_DETECTED112.

FIG. 5B depicts the graphical model 100 following the application of thepresent invention to the graphical model. The graphical model 100depicts a Shutdown state 102 and a Normal state 104. The labels for bothstates are unchanged as neither label represents a textual item havingintrinsic executable computational meaning. The transition from theShutdown state 102 to the Normal state 104 still includes textual itemsRESTART 106, START 108 and variable numFailures ==0 (110). Similarly,the transition from the Normal State 104 to the Shutdown state 102 stillincludes the textual item FAULT_DETECTED 112. However, the textual itemsRESTART 106, START 108 and FAULT_DETECTED 112 in the transitions betweenstates have all been boxed 116, 118 and 122 to indicate that theyrepresent textual items having intrinsic executable computationalmeaning. In the present example the textual items are event names andrefer to the event code for the events that trigger the transitionsbetween states.

In FIG. 6A and FIG. 6B, the system 100 of FIG. 5A and FIG. 5B is shownwith a second transition 200 between the normal state 120 and theshutdown state 104. The second transition 200 includes two textualitems, a graphical function “cool( )” 202, which is also shown in detail210, and custom textual code “active_sensors( )” 204. FIG. 6A shows thesystem 100 without any indicators. FIG. 6B shows the system 100 withindicators in which the text referring to the graphical function “cool”202 has been boxed while the textual item referring to the customtextual code “active-sensors” 204 has been highlighted. Those skilled inthe art will recognize that alternative indicators based oncharacteristics of the identified textual items with intrinsicexecutable computational meaning may be used to achieve the same effectsuch as coloring the graphical function one color and the custom textualcode another color. The use of different indicators based oncharacteristics helps greatly in understanding the overall makeup of thesystem.

Those skilled in the art will recognize that the present invention maybe extended to provide indicators for other types of textual items inaddition to those textual items having intrinsic executablecomputational meaning. For example, the language processor could beinstructed to provide indicators for symbols that refer to input versusoutput data. Alternatively, the language processor could provideindicators for global data access, non-volatile data symbols, volatiledata symbols or symbols that refer to data defined in a data dictionary.Other possible implementations will be apparent to those skilled in theart.

It should be noted that although the examples contained herein havereferred to the language processor as the entity assigning theindicators to the textual items identified as having intrinsicexecutable computational meaning, a separate process using the resultsof the language processor to perform similar functions is specificallycontemplated as within the scope of the present invention.

The timing of the application of indicators to the textual items in thegraphical model may vary depending upon the implementation. For example,in one implementation, the indicators will be applied in editing mode toa line of code whenever a user changes the focus such as by switchingthe mouse cursor to another line or hitting return on the keyboard. Thisapplication of the indicators provides a validity check to the user inthe event of invalid entries as the language processor will not applythe indicator to text which does not process as a textual item with anintrinsic executable computational meaning. In other words, a misspelledkeyword will not be highlighted or otherwise indicated on the graphicalmodel and will accordingly be apparent to the user who would expect theindicator to be present. In an alternative implementation, theindicators may be applied to the graphical model as part of a commandcompletion process during editing of the model by a user. In otherwords, the auto-completion of a textual item having intrinsic executablecomputational meaning being entered by a user may result in theimmediate application of an indicator to the textual item in thegraphical model. The timing of other implementations such as theapplication of indicators to identified textual elements during asimulation will be recognized by those skilled in the art.

The present invention may be provided as one or more computer-readableprograms embodied on or in one or more mediums. The mediums may be afloppy disk, a hard disk, a compact disc, a digital versatile disc, aflash memory card, a PROM, a RAM, a ROM, or a magnetic tape. In general,the computer-readable programs may be implemented in any programminglanguage. Some examples of languages that can be used include C, C++,C#, or JAVA. The software programs may be stored on or in one or moremediums as object code.

Since certain changes may be made without departing from the scope ofthe present invention, it is intended that all matter contained in theabove description or shown in the accompanying drawings be interpretedas illustrative and not in a literal sense. Practitioners of the artwill realize that the sequence of steps and architectures depicted inthe figures may be altered without departing from the scope of thepresent invention and that the illustrations contained herein aresingular examples of a multitude of possible depictions of the presentinvention.

1. In a computational device with a graphical language environment, amethod comprising: examining a graphical model to identify text havingintrinsic executable computational meaning within the graphical model;identifying at least one textual item with intrinsic executablecomputational meaning; and providing an indicator that the identifiedtextual item has intrinsic executable computational meaning in a displayof the graphical model.
 2. The method of claim 1 wherein the type ofindicator provided is based upon a characteristic of the identifiedtextual item.
 3. The method of claim 1, wherein the text havingintrinsic executable computational meaning represents one of the groupof events, data, a graphical function name, a hard coded number, alinked requirement, or a keyword.
 4. The method of claim 1, furthercomprising: providing an abstract syntax tree generated from thegraphical model, the abstract syntax tree used in the identification ofthe at least one textual item.
 5. The method of claim 1 wherein thegraphical model is one of the group of a state diagram, or a blockdiagram.
 6. The method of claim 1, wherein the providing of theindicator comprises further: highlighting the identified at least onetextual item in the display of the graphical model.
 7. The method ofclaim 1, wherein the providing of the indicator comprises further:coloring the text of the identified at least one textual item in a colordifferent from any adjacent surrounding text in the display of thegraphical model.
 8. The method of claim 7 wherein at least two textualitems with different types of intrinsic executable computational meaningare provided with different colors.
 9. The method of claim 1, comprisesfurther: while in editing mode, providing the visual indicatorsubsequent to a change of focus command received from an input devicebeing manipulated by a user editing the graphical model.
 10. The methodof claim 1, comprising further: identifying an incomplete textual itemwith intrinsic executable computational meaning being entered by a uservia an input device; completing programmatically the entry of thetextual item without additional input from a user; and providing thevisual indicator for the programmatically completed entry.
 11. Themethod of claim 1 wherein the textual item with intrinsic executablecomputational meaning is one of the group of an input data symbol, anoutput data symbol, a global data access symbol, non-volatile datasymbol, volatile data symbol or a symbol that refers to data defined ina data dictionary.
 12. The method of claim 1 wherein the identifiedtextual item with computation meaning is one of the group of text withina displayed state and text in a displayed transition between states. 13.The method of claim 1, comprising further: identifying a user-enteredexpression as an invalid expression; and removing a previously displayedindicator based on the invalidity.
 14. A system for indicating textualitems with intrinsic executable computational meaning within a graphicalenvironment, comprising: a graphical model, the graphical modelincluding textual and graphical components; a language processor forevaluating the textual components in the graphical model; and a listinggenerated as a result of the evaluation of the textual components in thegraphical model by the language processor, the listing identifying atleast one textual component with intrinsic executable computationalmeaning, the identified at least one textual component with intrinsicexecutable computational meaning altered in appearance in a display ofthe graphical model to a user based on a characteristic of theidentified textual item.
 15. The system of claim 14 wherein thegraphical model is one of the group of a state diagram, block diagram ordata flow diagram.
 16. The system of claim 14 wherein the identifiedtextual component with intrinsic executable computational meaning isidentified in the display of the graphical model by highlighting thetextual component with intrinsic executable computational meaning. 17.The system of claim 14 wherein the identified textual component withintrinsic executable computational meaning is identified in the displayof the graphical model by altering the color of the textual componentwith intrinsic executable computational meaning.
 18. A medium in anelectronic device with a graphical language environment, the mediumholding computer-executable instructions comprising: examining agraphical model to identify text having intrinsic executablecomputational meaning within the graphical model; identifying at leastone textual item with intrinsic executable computational meaning; andproviding an indicator that the identified textual item has intrinsicexecutable computational meaning in a display of the graphical model.19. The medium of claim 18 wherein the type of indicator provided isbased upon a characteristic of the identified textual item.
 20. Themedium of claim 18 wherein the graphical model is one of the group of astate diagram, or a block diagram.
 21. The medium of claim 18, whereinthe instructions further comprise: highlighting the identified at leastone textual item in the display of the graphical model.
 22. The mediumof claim 18, wherein the instructions further comprise: coloring thetext of the identified at least one textual item in a color differentfrom any adjacent surrounding text in the display of the graphicalmodel.
 23. A distributed system for indicating textual items withintrinsic executable computational meaning within a graphicalenvironment, comprising: a server hosting a graphical languageenvironment, wherein the graphical language environment furthercomprises: a graphical model, the graphical model including textual andgraphical components; a language processor for evaluating the textualand graphical components in the graphical model; and a listing ofexecutable textual components in the graphical model generated as aresult of the evaluation of the graphical model by the languageprocessor, the listing identifying textual components with intrinsicexecutable computational meaning, the identified textual components withintrinsic executable computational meaning altered in appearance in adisplay of the graphical model to a user; a client communicating withthe server over a network; a display device in communication with theclient, the display device displaying the graphical model with thealtered textual items to a user.
 24. The distributed system of claim 23wherein the appearance is altered based upon a characteristic of theidentified textual component.